﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmallShop.Services.Code
{
    public class SecretCodeGenerate
    {
        public static string Generate(int length)
        {
            char[] param = { ',' };
            string[] s = "q,w,e,r,t,y,u,i,o,p,a,s,d,f,g,h,j,k,l,z,x,c,v,b,n,m,Q,W,E,R,T,Y,U,I,O,P,A,S,D,F,G,H,J,K,L,Z,X,C,V,B,N,M,1,2,3,4,5,6,7,8,9,0".Split(param);
            string result = "";
            Random r = new Random();
            for (int i = 1; i <= length; i++)
            {
                int j = r.Next(1, 62);
                result += s[j];
            }
            return result;
        }
    }
}
